import React, {Component} from 'react';

import Head from '../Header';
import SideBar from '../Sidebar';
import {Layout} from 'antd';

import './index.less';

const {Content} = Layout;

export default class Common extends Component {

    render() {
        const {
            userInfo,
            pathname,
            children
        } = this.props;

        return (
            <Layout>
                <SideBar pathname={pathname} />
                <Layout>
                    <Head userInfo={userInfo} />
                    <Content style={{background: '#ececec', margin: '16px'}}>
                        <div style={{padding: 24, background: '#fff', minHeight: 360}}>
                            {children}
                        </div>
                    </Content>
                </Layout>
            </Layout>
        );
    }
}
